unit uStudentImpl;

interface

type

  IStudent = interface
  ['{8059720B-82E3-44C4-AA60-5382C95208F4}']
    function GetLogin: WideString;
    procedure SetLogin(Value: WideString);
    function GetPassword: WideString;
    procedure SetPassword(Value: WideString);
    function GetName: WideString;
    procedure SetName(Value: WideString);
    function GetSurname: WideString;
    procedure SetSurname(Value: WideString);
    function GetGroup: WideString;
    procedure SetGroup(Value: WideString);

    property Login: WideString read GetLogin write SetLogin;
    property Password: WideString read GetPassword write SetPassword;
    property Name: WideString read GetName write SetName;
    property Surname: WideString read GetSurname write SetSurname;
    property Group: WideString read GetGroup write SetGroup;
  end;

  TStudent = class(TInterfacedObject, IStudent)
  private
    fLogin: WideString;
    fPassword: WideString;
    fName: WideString;
    fSurname: WideString;
    fGroup: WideString;
  protected
    function GetLogin: WideString;
    procedure SetLogin(Value: WideString);
    function GetPassword: WideString;
    procedure SetPassword(Value: WideString);
    function GetName: WideString;
    procedure SetName(Value: WideString);
    function GetSurname: WideString;
    procedure SetSurname(Value: WideString);
    function GetGroup: WideString;
    procedure SetGroup(Value: WideString);
  end;

  function NewStudent(const aLogin: WideString = ''): IStudent;

implementation

function NewStudent(const aLogin: WideString = ''): IStudent;
begin
  Result := TStudent.Create;
  Result.Login := aLogin;
end;

{ TStudent }

function TStudent.GetGroup: WideString;
begin
  Result := fGroup;
end;

function TStudent.GetLogin: WideString;
begin
  Result := fLogin;
end;

function TStudent.GetName: WideString;
begin
  Result := fName;
end;

function TStudent.GetPassword: WideString;
begin
  Result := fPassword;
end;

function TStudent.GetSurname: WideString;
begin
  Result := fSurname;
end;

procedure TStudent.SetGroup(Value: WideString);
begin
  fGroup := Value;
end;

procedure TStudent.SetLogin(Value: WideString);
begin
  fLogin := Value;
end;

procedure TStudent.SetName(Value: WideString);
begin
  fName := Value;
end;

procedure TStudent.SetPassword(Value: WideString);
begin
  fPassword := Value;
end;

procedure TStudent.SetSurname(Value: WideString);
begin
  fSurname := Value;
end;

end.
